//package com.hong.spring.datasource.dao;
//
//import com.hong.spring.datasource.entity.User;
//import org.apache.logging.log4j.LogManager;
//import org.apache.logging.log4j.Logger;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.jdbc.core.JdbcTemplate;
//import org.springframework.stereotype.Repository;
//
///**
// * @Auther: csh
// * @Date: 2020/8/4 15:52
// * @Description:用户dao
// */
//@Repository
//public class UserDao {
//
//    private static Logger log = LogManager.getLogger(UserDao.class);
//
//    @Autowired
//    private JdbcTemplate jdbcTemplate;
//
//    public int save(User user){
//        String sql = "Insert into user(user_name,age)values(?,?);";
//        int save = jdbcTemplate.update(sql,user.getUsername(),user.getAge());
//        log.info("保存结果{}",save>0?"成功":"失败");
//        return save;
//    }
//
//
//}
